package com.jackchong.utils;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @ClassName: ViewPagerAdapter
 * @Author: 冻品
 * @CreateDate: 2020-03-19 16:32
 * @UpdateUser: 小笼包
 * @Version: 1.0
 * @Description: java类作用描述
 */
public class ViewPagerAdapter extends FragmentPagerAdapter {
    private List<? extends Fragment> list;

    public <T extends Fragment> ViewPagerAdapter(FragmentManager fm, List<T> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int i) {
        return list.get(i);
    }

    @Override
    public int getCount() {
        return list.size();
    }

}
